import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: '主页',
    component: HomeView
  },
  {
    path: '/about',
    name: '关于',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path:'/blog',
    name:"动态",
    component: () => import(/* webpackChunkName: "about" */ '../views/BlogView.vue')
  },
  {
    path:'/notice',
    name:'公告',
    component: () => import(/* webpackChunkName: "about" */ '../views/NoticeView.vue')
  },
  {
    path:'/travel',
    name:'景区信息',
    component: () => import(/* webpackChunkName: "about" */ '../views/TravelView.vue')
  },
  {
    path:'/weather',
    name:'天气',
    component: () => import(/* webpackChunkName: "about" */ '../views/WeatherView.vue')
  },
  {
    path:'/travel-info/:id',
    name:'景区详情',
    component: () => import(/* webpackChunkName: "about" */ '../views/TravelInfoView.vue')
  },
  {
    path:'/userInfo',
    name:'个人中心',
    component: () => import(/* webpackChunkName: "about" */ '../views/UserInfoView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
